#include "wwdg.h"

/* WWDG init function */
void MX_WWDG_Init(void)
{
    rcu_periph_clock_enable(RCU_WWDGT);

    /*!
     *  set WWDGT clock = (PCLK1 (30MHz)/4096)/4 = 2197Hz (~546 us)
     *  set counter value to 107
     *  set window value to 107
     *  refresh window is: ~546 * (107-107)= 0ms < refresh window < ~546 * (107-63) =24 ms.
     *  当计数值达到0x40或者在计数值达到窗口寄存器之前更新计数器的时候该中断产生 --counter = window

     */
    wwdgt_config(107, 107, WWDGT_CFG_PSC_DIV4);
    wwdgt_enable();
}


